home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Pascal Super Library
/
Pascal Super Library (CW International)(1997).bin
/
LIBRARY
/
PASCALL
/
CLOCKIN
/
CLOCK5.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1992-12-25
|
2KB
|
71 lines
program graphclock;
uses
graph,graphin1,dos,crt;
var
beeper,stop:boolean;
const
lasthour:word=hrhandsize;
lastminute:word=minhandsize;
lastsecond:word=sechandsize;
lasthundrethofasecond:word=hndthsechandsize;
var
hour,minute,second,hundrethofasecond:word;
procedure putoutclock;
const
lasthour:word=hrhandsize;
lastminute:word=minhandsize;
lastsecond:word=sechandsize;
lasthundrethofasecond:word=hndthsechandsize;
var
hour,minute,second,hundrethofasecond:word;
begin
repeat
gettime(hour,minute,second,hundrethofasecond);
if not(lasthour=hour) then begin
puthand(lasthour,hour,hr);
lasthour:=hour;
end;
if not(lastminute=minute) then begin
puthand(lastminute,minute,min);
lastminute:=minute;
end;
if not(lastsecond=second) then begin
puthand(lastsecond,second,sec);
if beeper then beep;
lastsecond:=second;
end;
if not(lasthundrethofasecond=hundrethofasecond) then begin
puthand(lasthundrethofasecond,hundrethofasecond,hndthsec);
lasthundrethofasecond:=hundrethofasecond;
end;
until keypressed;
end;
procedure done;
begin
restorecrtmode;
closegraph;
halt;
end;
procedure doit;
begin
putoutclock;
case upcase(readkey) of
'S':beeper:=not(beeper);
chr(27):done;
end;
doit;
end;
begin
beeper:=true;
setupgraph;
setupgrid;
centerx:=319;
centerc:=319;
doit;
done;
end.